package com.tx.websocket.demo.service.impl;

import java.util.List;
import javax.annotation.Resource;

import com.tx.websocket.demo.dao.RoleResourceRelDao;
import com.tx.websocket.demo.model.RoleResourceRel;
import com.tx.websocket.demo.service.RoleResourceRelService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
public class RoleResourceRelServiceImpl implements RoleResourceRelService {

    @Resource
    private RoleResourceRelDao roleResourceRelDao;

    @Transactional
    @Override
    public Integer addRoleResourceRel(RoleResourceRel roleResourceRel) {
        return roleResourceRelDao.addRoleResourceRel(roleResourceRel);
    }

    @Transactional(readOnly = true)
    @Override
    public List<RoleResourceRel> listRoleResourceRel(RoleResourceRel roleResourceRel) {
        return roleResourceRelDao.listRoleResourceRel(roleResourceRel);
    }

    @Transactional(readOnly = true)
    @Override
    public RoleResourceRel getRoleResourceRelByPrimaryKey(Long resourceId, Long roleId) {
        return roleResourceRelDao.getRoleResourceRelByPrimaryKey(resourceId, roleId);
    }

    @Transactional
    @Override
    public Integer delRoleResourceRelByPrimaryKey(Long resourceId, Long roleId) {
        return roleResourceRelDao.delRoleResourceRelByPrimaryKey(resourceId, roleId);
    }

    @Transactional
    @Override
    public Integer updateRoleResourceRel(RoleResourceRel roleResourceRel) {
        return roleResourceRelDao.updateRoleResourceRel(roleResourceRel);
    }

}
